package com.bw.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bw.dao.RoleMapper;
import com.bw.entity.Role;
import com.bw.service.RoleService;

@Service(value = "roleService")
public class RoleServiceImpl implements RoleService {

    @Autowired
    private RoleMapper<Role>roleMapper;
    
    @Override
    public Integer insertSelective(Role role) throws Exception {
           return this.roleMapper.insertSelective(role);
        }

    @Override
    public Integer insertBatch(List<Role> role) throws Exception {
           return this.roleMapper.insertBatch(role) ;
        }

    @Override
    public Integer deleteByPrimaryKey(Object id) {
            return this.roleMapper.deleteByPrimaryKey(id);
    }

    public Integer deleteBatchByPrimaryKey(List<Object> ids) {
           return this.roleMapper.deleteBatchByPrimaryKey(ids);
    }

    @Override
    public Integer updateByPrimaryKeySelective(Role role) {
           return this.roleMapper.updateByPrimaryKeySelective(role);
    }

    @Override
    public Role findById(Object id) {
           return (Role) this.roleMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Role> selectByCondition(Role role) {
           return (List<Role>) this.roleMapper.selectByCondition(role);
    }

    @Override
    public Integer selectCountByCondition(Role role) {
           return  this.roleMapper.selectCountByCondition(role);
    }

}
